package com.smart.controller;

import com.smart.common.WebResponse;
import com.smart.model.vo.StreetVO;
import com.smart.service.StreetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhanghong
 */
@RestController
@RequestMapping("/street")
@Api(tags = {"A通用模板#查询街道模板"})
public class StreetController {

    @Autowired
    private StreetService streetService;

    @ApiOperation("根据areaCode查询接到列表，固定查询大兴区：110115")
    @PostMapping("/queryStreetByAreaCode/{areaCode}")
    @ApiImplicitParam(name = "areaCode", value = "区域编码", required = true, defaultValue = "110115")
    public WebResponse<List<StreetVO>> queryStreetByAreaCode(@PathVariable("areaCode") String areaCode) {
        return WebResponse.build(streetService.queryStreetByAreaCode(areaCode));
    }
}
